package top.zhangjianyong.blog.portal.controller;

import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import top.zhangjianyong.blog.constant.RequestHeaderKey;
import top.zhangjianyong.blog.params.blog.BlogLikeParam;
import top.zhangjianyong.blog.response.ApiResponse;
import top.zhangjianyong.blog.service.BlogVisitService;

/**
 * @author zhangjianyong
 * @since 2025/6/24 16:28
 */
@RequestMapping("/portal/blog/visit")
@RestController("portalBlogVisitController")
public class BlogVisitController {

  @Resource private BlogVisitService blogLikeService;

  @PostMapping("/save")
  public ApiResponse save(
      @RequestBody @Validated BlogLikeParam param,
      @RequestHeader(RequestHeaderKey.VISITOR_UUID) String uuid) {
    return blogLikeService.save(param, uuid);
  }
}
